Portable devices such as smart phones, tablet computers and notebook computers are widespread. A portable device includes a flat-panel display device using a liquid crystal or an organic EL element, etc. A display device includes a two-dimensional array of pixels, the pixel includes a common electrode and a pixel electrode, and the liquid crystal or the organic EL element is arranged between the common electrode and the pixel electrode. When a driver writes a pixel signal to the pixel, the liquid crystal or the organic EL element between the common electrode and the pixel electrode is controlled, and an image is displayed.
Meanwhile, a touch panel which detects approach or contact of an input object such as a finger or a touch pen (which is also referred to as a stylus pen) to or with a screen is widely used. An operation of approaching or contacting the input object to or with the screen is referred to as a touch operation or a touch, and detection of the position of the input object is referred to as touch detection. A small area can be specified or a handwriting character can be input more easily by the pen than by the finger. A touch of the pen can be detected by various methods, and one of the methods is an electromagnetic induction method. In the electromagnetic induction method, the pen includes a coil and a capacitor, the touch panel includes a transmitting coil and a receiving coil, the transmitting coil generates a magnetic field, magnetic field energy is stored in the capacitor of the pen, and the receiving coil detects the magnetic field.
In a display device having the electromagnetic induction type touch detection function, noises are caused by the influence of the parasitic capacitance and parasitic resistance of the display device, and detection cannot be accurate.